package cn.aws360.boot.wechat.api.exception;

import cn.aws360.boot.base.api.exception.enums.AbstractExceptionEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import static cn.aws360.boot.wechat.api.constant.WxmConstant.*;

/**
 * @author junnan
 */
@Getter
@RequiredArgsConstructor
public enum WxmExceptionEnum implements AbstractExceptionEnum {

    /**
     * 微信公众号交互模块
     */
    WX_MP_AUTH_CONF_EXCEPTION(MODULE_WX_MP_PORTAL_NAME, MODULE_WX_MP_PORTAL_CODE + "11", "公众号授权配置异常, appId: {}"),
    WX_MP_AUTH_SIGN_EXCEPTION(MODULE_WX_MP_PORTAL_NAME, MODULE_WX_MP_PORTAL_CODE + "12", "公众号授权签名异常, appId: {}"),
    WX_MP_GET_TOKEN_EXCEPTION(MODULE_WX_MP_PORTAL_NAME, MODULE_WX_MP_PORTAL_CODE + "21", "公众号获取令牌异常, code: {}"),
    WX_MP_UPLOAD_MEDIA_EXCEPTION(MODULE_WX_MP_PORTAL_NAME, MODULE_WX_MP_PORTAL_CODE + "22", "公众号上传素材异常, code: {}"),

    /**
     * 应用管理模块
     */
    WXM_APP_NOT_EXIST(MODULE_WXM_APP_NAME, MODULE_WXM_APP_CODE + "11", "应用不存在或已删除!"),
    WXM_APP_ID_HAS_EXIST(MODULE_WXM_APP_NAME, MODULE_WXM_APP_CODE + "21", "应用 appId: {}, 应用 ID 已存在!"),


    /**
     * 语料管理模块
     */
    WXM_CORPUS_NOT_EXIST(MODULE_WXM_CORPUS_NAME, MODULE_WXM_CORPUS_CODE + "11", "语料不存在或已删除!"),

    ;

    private final String module;
    private final String errCode;
    private final String userTip;

}